﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DataSetDatabaseFragmentation" targetNamespace="http://tempuri.org/DataSetDatabaseFragmentation.xsd" xmlns:mstns="http://tempuri.org/DataSetDatabaseFragmentation.xsd" xmlns="http://tempuri.org/DataSetDatabaseFragmentation.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection ConnectionStringObject="Data Source=SEREENA-PC\SEREENASQL2008,2133;Initial Catalog=SQLServerHealthCheckDeploy;Integrated Security=True;Pooling=False" IsAppSettingsProperty="false" Modifier="Assembly" Name="sereena-pc\sereenasql2008.SQLServerHealthCheckDeploy.dbo" ParameterPrefix="@" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="TableAdapterDatabaseFragmentation" GeneratorDataComponentClassName="TableAdapterDatabaseFragmentation" Name="DataTableDatabaseFragmentation" UserDataComponentName="TableAdapterDatabaseFragmentation">
            <MainSource>
              <DbSource ConnectionRef="sereena-pc\sereenasql2008.SQLServerHealthCheckDeploy.dbo" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>

SELECT        svr.Name AS Server, svc.Name AS InstanceName, db.DatabaseName, dt.TableName, ifd.IndexName, ifd.IndexType, CONVERT(DECIMAL(16, 1), ifd.IndexSize) 
                         AS IndexSize, ifd.Statistics_LastUpdatedDate AS StatsUpdatedDate, ifd.Fragmentation, ifd.Recommendation
FROM            IndexFragmentationDetail AS ifd INNER JOIN
                         DatabaseTableDetail AS dt ON dt.TableID = ifd.TableID INNER JOIN
                         [Database] AS db ON dt.DatabaseID = db.DatabaseID INNER JOIN
                         Service AS svc ON db.ServiceID = svc.ServiceID INNER JOIN
                         Server AS svr ON svc.ServerID = svr.ServerID

</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Server" DataSetColumn="Server" />
              <Mapping SourceColumn="InstanceName" DataSetColumn="InstanceName" />
              <Mapping SourceColumn="DatabaseName" DataSetColumn="DatabaseName" />
              <Mapping SourceColumn="TableName" DataSetColumn="TableName" />
              <Mapping SourceColumn="IndexName" DataSetColumn="IndexName" />
              <Mapping SourceColumn="IndexType" DataSetColumn="IndexType" />
              <Mapping SourceColumn="StatsUpdatedDate" DataSetColumn="StatsUpdatedDate" />
              <Mapping SourceColumn="Fragmentation" DataSetColumn="Fragmentation" />
              <Mapping SourceColumn="Recommendation" DataSetColumn="Recommendation" />
              <Mapping SourceColumn="IndexSize" DataSetColumn="IndexSize" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="DataSetDatabaseFragmentation" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DataSetDatabaseFragmentation" msprop:Generator_UserDSName="DataSetDatabaseFragmentation">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="DataTableDatabaseFragmentation" msprop:Generator_TableClassName="DataTableDatabaseFragmentationDataTable" msprop:Generator_TableVarName="tableDataTableDatabaseFragmentation" msprop:Generator_TablePropName="DataTableDatabaseFragmentation" msprop:Generator_RowDeletingName="DataTableDatabaseFragmentationRowDeleting" msprop:Generator_UserTableName="DataTableDatabaseFragmentation" msprop:Generator_RowChangingName="DataTableDatabaseFragmentationRowChanging" msprop:Generator_RowEvHandlerName="DataTableDatabaseFragmentationRowChangeEventHandler" msprop:Generator_RowDeletedName="DataTableDatabaseFragmentationRowDeleted" msprop:Generator_RowEvArgName="DataTableDatabaseFragmentationRowChangeEvent" msprop:Generator_RowChangedName="DataTableDatabaseFragmentationRowChanged" msprop:Generator_RowClassName="DataTableDatabaseFragmentationRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Server" msprop:Generator_ColumnVarNameInTable="columnServer" msprop:Generator_ColumnPropNameInRow="Server" msprop:Generator_ColumnPropNameInTable="ServerColumn" msprop:Generator_UserColumnName="Server" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="InstanceName" msprop:Generator_ColumnVarNameInTable="columnInstanceName" msprop:Generator_ColumnPropNameInRow="InstanceName" msprop:Generator_ColumnPropNameInTable="InstanceNameColumn" msprop:Generator_UserColumnName="InstanceName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="DatabaseName" msprop:Generator_ColumnVarNameInTable="columnDatabaseName" msprop:Generator_ColumnPropNameInRow="DatabaseName" msprop:Generator_ColumnPropNameInTable="DatabaseNameColumn" msprop:Generator_UserColumnName="DatabaseName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="TableName" msprop:Generator_ColumnVarNameInTable="columnTableName" msprop:Generator_ColumnPropNameInRow="TableName" msprop:Generator_ColumnPropNameInTable="TableNameColumn" msprop:Generator_UserColumnName="TableName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="IndexName" msprop:Generator_ColumnVarNameInTable="columnIndexName" msprop:Generator_ColumnPropNameInRow="IndexName" msprop:Generator_ColumnPropNameInTable="IndexNameColumn" msprop:Generator_UserColumnName="IndexName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="IndexType" msprop:Generator_ColumnVarNameInTable="columnIndexType" msprop:Generator_ColumnPropNameInRow="IndexType" msprop:Generator_ColumnPropNameInTable="IndexTypeColumn" msprop:Generator_UserColumnName="IndexType" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="StatsUpdatedDate" msprop:Generator_ColumnVarNameInTable="columnStatsUpdatedDate" msprop:Generator_ColumnPropNameInRow="StatsUpdatedDate" msprop:Generator_ColumnPropNameInTable="StatsUpdatedDateColumn" msprop:Generator_UserColumnName="StatsUpdatedDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Fragmentation" msprop:Generator_ColumnVarNameInTable="columnFragmentation" msprop:Generator_ColumnPropNameInRow="Fragmentation" msprop:Generator_ColumnPropNameInTable="FragmentationColumn" msprop:Generator_UserColumnName="Fragmentation" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Recommendation" msprop:Generator_ColumnVarNameInTable="columnRecommendation" msprop:Generator_ColumnPropNameInRow="Recommendation" msprop:Generator_ColumnPropNameInTable="RecommendationColumn" msprop:Generator_UserColumnName="Recommendation" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="60" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="IndexSize" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnIndexSize" msprop:Generator_ColumnPropNameInRow="IndexSize" msprop:Generator_ColumnPropNameInTable="IndexSizeColumn" msprop:Generator_UserColumnName="IndexSize" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>